<template>
  <basic-container>
    <avue-crud
        v-if="tableOption"
        v-bind="bindVal"
        v-on="onEvent"
        v-model:page="page"
        v-model="startForm">
      <template v-for="(column,index) in columns" :slot="column.prop" slot-scope="{type,size,row}">
        <component :is="column.columnComponent" :row="row" :rowKey="column.prop" :column="column"></component>
      </template>
      <template #menu="scope">
        <el-button v-if="![-10,20].includes(scope.row.procHandlerState)" :type="scope.type" text
                   :disabled="scope.disabled"
                   :size="scope.size"
                   @click="cancelActEvent(scope.row)">取消
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
<script>
import {createDynamicMixin} from "@/mixins/startCrud";
import autoRouter from "@/views/start/activiti/autoRouter";

const optionConf = {
  name: "start/activiti/myActBusinessOption",
  optionPath: 'start/activiti/my/myDoneActBusiness',
  apiPath: 'start/activiti/core/startMyActTask',
  list: "pageMyDoneTask",
  permissionBtnHandler: {
    delBtn: (vm, row, defaultValue) => {
      return row.procHandlerState === -10
    }
  }
}
export default {
  mixins: [createDynamicMixin(optionConf)],
  data() {
    return {}
  },
  methods: {
    beforeLoadDataSource(search) {
      search.start_order_taskStartTime = "desc"
    },
    beforeOpenViewDialog(row) {
      let title = "流程详情【" + row.procDefName + "】" + row.actStartUser.userFinalName
      this.$router.push({name: autoRouter.names.taskDetail, params: {taskId: row.taskId, title: title}})
      return true;
    },
  }
}
</script>
<style scoped>

</style>